package work.base.generics;

/**
 * 定义了一个泛型类
 * @param <T> 坐标的类型 x 和 y这两个变量都是 <T>类型
 * @param <U> name变量是<U> 类型
 */
public class MorePoint<T,U> {
    private T x;
    private T y;

    private U name;

    public void setX(T x) {
        this.x = x;
    }
    public T getX() {
        return this.x;
    }

    public void setY(T y) {
        this.y = y;
    }
    public T getY() {
        return this.y;
    }

    public void setName(U name){
        this.name = name;
    }

    public U getName() {
        return this.name;
    }

    @Override
    public String toString() {
        return "MorePoint{" +
                "x=" + x +
                ", y=" + y +
                ", name=" + name +
                '}';
    }
}
